<?php
/*
#########################################################
#														#
#		Slawomir Mitak 									#
#		email: slawomirmitak@yahoo.com					#
#		form to search thru DB with suggestions			#
#														#
#########################################################*/

include('conn.db.php');

$counter=1;
//check data
$sql = "SELECT ProvenanceName FROM Provenance WHERE ProvenanceName LIKE '%'+?+'%'";
$params = array($_GET['keword']);
$query = sqlsrv_query($conn,$sql,$params);
$kewordLen = strlen(trim($_GET['keword']));

while( $row = sqlsrv_fetch_array( $query, SQLSRV_FETCH_ASSOC)){
	echo '<div class="proposal" id="prop'.$counter.'" onmouseover="hightDiv(this.id);" onmouseout="this.className=\'proposal\';" onclick="rStr(this.id);"><b>'.trim($_GET['keword']).'</b>'.substr($row['ProvenanceName'],$kewordLen).'</div>';
	$counter++;	
}
?>
